UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+jUbU7CATysqRktilP8Hoh7ODXXuoSoYJJa4uETIOfI=' 
WHERE 
  key_id = '8cd3dded05c0ed857b8ca6768bfd56e832fefcc921144f0f47176ebdb89bb5c5' 
  AND (
    token = '+jUbU7CATysqRktilP8Hoh7ODXXuoSoYJJa4uETIOfI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053