UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'moYYY8Q/xVKtSE1f4jwOf35YltUS6D9GCG1HTpGGlNI=' 
WHERE 
  key_id = '1656b4313e8d85b8200d957d6dd6b2be687ff03d64a850d812cf25dcd09d63e2' 
  AND (
    token = 'moYYY8Q/xVKtSE1f4jwOf35YltUS6D9GCG1HTpGGlNI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040