UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gpvpiMg+sHeZ7BYMQru2ffMl8f5HTBzqRzOiy06CPPg='
WHERE
key_id = '7309421bdb12822c13b7982d1e5fe88c6aaa0af2ad98994cd97bb9c353fee48c'
AND (
token = 'gpvpiMg+sHeZ7BYMQru2ffMl8f5HTBzqRzOiy06CPPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)