UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd92RSpVivnZKZOhUCHCzKaeZVUwvVG+C6eYBXcVDDgo='
WHERE
key_id = '8d2a91363c770efaeca3720b51c8a4b94bfa6a251a0c4516a7f8f6b00f9f7f23'
AND (
token = 'd92RSpVivnZKZOhUCHCzKaeZVUwvVG+C6eYBXcVDDgo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)