UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vms4Bc4pztoTgjuZIhjCYa4vgH+gG7QcJSVmj+tmq5s=' 
WHERE 
  key_id = 'de3e6b1d11636763d7a7b49d4ed6758e1225b5271ee2d5d0356855277b8540fa' 
  AND (
    token = 'Vms4Bc4pztoTgjuZIhjCYa4vgH+gG7QcJSVmj+tmq5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029