UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UR4BD36xoy9wC6f4/zOF3vbUySNOQOjXbOqNJOIUHXM='
WHERE
key_id = 'a083c9eda57b9892a1eb3a2a4452f81d7f871e05a48eb5beeb66b84e7d760084'
AND (
token = 'UR4BD36xoy9wC6f4/zOF3vbUySNOQOjXbOqNJOIUHXM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)