UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v9cs1ojfRcvCW8WXyJ58BglTDjn5ZTAm6o5JvzvCuN4=' 
WHERE 
  key_id = '304296a5649bcdc7619f2bddfe175c6832843b4fcaed37e8d2ec9bb01c61a7ac' 
  AND (
    token = 'v9cs1ojfRcvCW8WXyJ58BglTDjn5ZTAm6o5JvzvCuN4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029