UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6bWs/VSKalVPlX/XTwjQUdfuQM3N/O1lXcK1fKFSOIg=' 
WHERE 
  key_id = 'ecf2e6323dda7f0a839cd6f0b5d3fe0bb22d580ff937a111fc1fe7344cfa2c9f' 
  AND (
    token = '6bWs/VSKalVPlX/XTwjQUdfuQM3N/O1lXcK1fKFSOIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028