UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L99XbSdvTkEeqLdkYSq0zf3Y9VtjDloMuB1HLgGdTZI='
WHERE
key_id = '610a9f8684f796720d87b59ba29ace5254b433d2e6e32d19aa7e8e72f8f11fc1'
AND (
token = 'L99XbSdvTkEeqLdkYSq0zf3Y9VtjDloMuB1HLgGdTZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)