UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SOSTlboObQwiSBDTde3qu4TFz7bypHP1/pywkeigVFs=' 
WHERE 
  key_id = '4cf4f0ed3d4fc90de8f56a5cc4e759c2921aaa0e17fdd0196dade6a7c611281c' 
  AND (
    token = 'SOSTlboObQwiSBDTde3qu4TFz7bypHP1/pywkeigVFs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031