UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2DTWxdcyfg+BVrUSIF2tmP+4wIwVpUeRGucd77thMLE='
WHERE
key_id = 'b076a5d41459801491959cb206ee54706cb7185648715b459cf1c14512621b4c'
AND (
token = '2DTWxdcyfg+BVrUSIF2tmP+4wIwVpUeRGucd77thMLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)