UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+FaoDf7QwtnwpY3PDXKDl7gut0mftmF5kZu3Wnx3dsE='
WHERE
key_id = 'b55271243fb840048c246514bc83b4bb038f3b6f43dec23663d88b55bb205259'
AND (
token = '+FaoDf7QwtnwpY3PDXKDl7gut0mftmF5kZu3Wnx3dsE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)