UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4zsO9b2F3AzMOEYfmZxYZeezRUfYhE8B3nMfMSPI5Lc=' 
WHERE 
  key_id = '2b2a75e5c0528596f412ce20a60941d0a3a45ed5ead4ac89e8e563b38d6a7a84' 
  AND (
    token = '4zsO9b2F3AzMOEYfmZxYZeezRUfYhE8B3nMfMSPI5Lc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042