UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fYkjAHyqgpntHL3h86oHvrRoxe4gvOPghmA8LM3Liow='
WHERE
key_id = '0360ebe4baa8ed447ff828e7ae59e0561b986d7962b6e89854a521085d291232'
AND (
token = 'fYkjAHyqgpntHL3h86oHvrRoxe4gvOPghmA8LM3Liow='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)