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