UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wrc5USYIpiJ6i64h3bWnkFomLRDHXnP/4MavcaZ0pTw='
WHERE
key_id = 'f31484bb059a8aea900fcd7a3f853341055d0d4f9a6a194b96bab04a3f02dd2a'
AND (
token = 'Wrc5USYIpiJ6i64h3bWnkFomLRDHXnP/4MavcaZ0pTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)