UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jCdr4ePi6hinQKFCAjRCYNVNwzbToJtKGCdAlC+QEYc='
WHERE
key_id = '0a253cc45b06384412bd23fafe1c9b71d76beba0739e0a2cea47376a4b8b120f'
AND (
token = 'jCdr4ePi6hinQKFCAjRCYNVNwzbToJtKGCdAlC+QEYc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)