UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qyt7+QQpbmHiNYugCsDtMhV0GdF3GexliW2xAbWtLlQ=' 
WHERE 
  key_id = 'd9e84b26c96e06fe69dd4013f1fa4f1ed7668c03195d9bc967accef84aa15588' 
  AND (
    token = 'Qyt7+QQpbmHiNYugCsDtMhV0GdF3GexliW2xAbWtLlQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033