UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JOzolPfE3I7cWX61D47MjGykxPhv+sckI7jiZ3oaUKg=' 
WHERE 
  key_id = 'd745e4ea64cf4697701cf0d8697ae6ab0919b51acdc48e8f407f90825e1cf5af' 
  AND (
    token = 'JOzolPfE3I7cWX61D47MjGykxPhv+sckI7jiZ3oaUKg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032