UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DJt/DkniTt8NvtZNaqqpkT5L3cSEV0umiTztYS/HqhA='
WHERE
key_id = 'ff590d4fc322502d082188c4588cd0119bb11ea1dafd6f54d8c5b42a5dadf4bc'
AND (
token = 'DJt/DkniTt8NvtZNaqqpkT5L3cSEV0umiTztYS/HqhA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)