UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a8LHRbvl73urnTdRlU3sHV/YHsg+tAEJltJJvPO9kRI=' 
WHERE 
  key_id = '311234795e6e28d066f0def0956b76cabbbfe0f7122747c7a552f581127654ae' 
  AND (
    token = 'a8LHRbvl73urnTdRlU3sHV/YHsg+tAEJltJJvPO9kRI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020