UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vJZh56aWsWujIvu4mq2yYo+HCHUd5tUc/FFheEIYLx0=' 
WHERE 
  key_id = '574e25caf4d6d82b67374891a36ce3b26209cd23c195cf53beee8f4385851e77' 
  AND (
    token = 'vJZh56aWsWujIvu4mq2yYo+HCHUd5tUc/FFheEIYLx0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045