UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZIncAqFwP2p6hJf13xdVPv5eBv/X/eqA4gJzrXLaaLQ=' 
WHERE 
  key_id = '0eb661dd993e129c788d252e8c821585da45c2e7de97f87e49d9bc4d5de5deaa' 
  AND (
    token = 'ZIncAqFwP2p6hJf13xdVPv5eBv/X/eqA4gJzrXLaaLQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029