UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6VFweRjuQVS/ysH8lU8GLWsYU+dnir0x0pBqEh3Ug7o=' 
WHERE 
  key_id = 'd46cc82bb7bbc83c4a26f933745acc75bcbed7d03373f1486a30d44b632721c0' 
  AND (
    token = '6VFweRjuQVS/ysH8lU8GLWsYU+dnir0x0pBqEh3Ug7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017