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