UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/TixH93PXCFX2VIeNeewxBGHBamk8A9HUknnRKeyGI0=' 
WHERE 
  key_id = '87249e8dc6f651d75647f039221c1f2c8fe495c6d9e42465bb7c67274bc12e1d' 
  AND (
    token = '/TixH93PXCFX2VIeNeewxBGHBamk8A9HUknnRKeyGI0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028