UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GXJ/MS+JsvPiJrwHo5HOQgGuowE+5XEiG2k+eGxLT5w=' 
WHERE 
  key_id = '012d57dbf93310857a89147ee06573614f5b8139a32832abd21c604c53735001' 
  AND (
    token = 'GXJ/MS+JsvPiJrwHo5HOQgGuowE+5XEiG2k+eGxLT5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031