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