UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4CTZP+HrvpHpJDInxrXttdKUhi1tj4p9IZcMb7VlR3k=' 
WHERE 
  key_id = '07762fded85b9de1ebe4a1fdb38fd59689f231f89284ef87d3922f3179df139b' 
  AND (
    token = '4CTZP+HrvpHpJDInxrXttdKUhi1tj4p9IZcMb7VlR3k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030