UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RJD6bhxspWM1o8lbpAI1NN/6Li44K7SjUFQuvAPFKRI=' 
WHERE 
  key_id = '180710b972b52fbafef14acd9d74581d4911323c9f153e1c3d92d453a060891d' 
  AND (
    token = 'RJD6bhxspWM1o8lbpAI1NN/6Li44K7SjUFQuvAPFKRI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027