UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pHmkhfrspZnEivzEVHQKLmw38mAjkyvEhH1G9ODiLKE='
WHERE
key_id = 'fe0ce5daed3eca8ffd2d1dc6e8eafcdae971ec26746b0f8d582a90a31cfa0afa'
AND (
token = 'pHmkhfrspZnEivzEVHQKLmw38mAjkyvEhH1G9ODiLKE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)