UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SMR4fLi6ZEPliWbEvUDRvcqxlYKKoCwi7udKOT4aDbk='
WHERE
key_id = '25a1535fefd85be4123f64ea455f48921388704b895260ca3cad1da3c857f8ec'
AND (
token = 'SMR4fLi6ZEPliWbEvUDRvcqxlYKKoCwi7udKOT4aDbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)