UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cdh1ypcQI08/sHDp3lHyMeqzpInbUnF3rLQyL8HzaN8='
WHERE
key_id = 'e45175f752f3686c2dd9385739a4202693fff87f90fcfa294b6e2cc4f7dadbd9'
AND (
token = 'cdh1ypcQI08/sHDp3lHyMeqzpInbUnF3rLQyL8HzaN8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)