UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qtVDZEzva2ufZNf3Dz3QngozocRsXFeEZFfYE7UrlZc=' 
WHERE 
  key_id = '48d3f601394e38feed46915e8b3375ce6c41234b9c22069b206856014aa83f4e' 
  AND (
    token = 'qtVDZEzva2ufZNf3Dz3QngozocRsXFeEZFfYE7UrlZc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061