UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EXwQ3sefveBMa8SCerIhelhnz6iI1FJOLZ3yKHWgY4M='
WHERE
key_id = '6f4ba508585f7d701b5b2fa785381fd068c516879f2117af870547222219ab27'
AND (
token = 'EXwQ3sefveBMa8SCerIhelhnz6iI1FJOLZ3yKHWgY4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)