UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9V+s+FuamAKOpBtLmJZe3xinqEkv154DcKNjDRgw2CM=' 
WHERE 
  key_id = '79a3099608cbb58853059ae2c4a3c415e55435930135e255562a3a17315d258c' 
  AND (
    token = '9V+s+FuamAKOpBtLmJZe3xinqEkv154DcKNjDRgw2CM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031