UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5jBBwJuZm12fpdfyK2PtwFQOQ90fnZwpPQFHIhdYVsc='
WHERE
key_id = '2b4c1d04cadcb5e3dae9905a10b339f51d8c3fecde531e422d8ff12c72cc1af7'
AND (
token = '5jBBwJuZm12fpdfyK2PtwFQOQ90fnZwpPQFHIhdYVsc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)