UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dPg2Ry0deDj9gSqasVbND5mu/GUm/8gwVrYVckZMACU=' 
WHERE 
  key_id = '69ca886c4887dd6c894330764d742d86c8dd20e8eee8391abc75cd22e25d2b11' 
  AND (
    token = 'dPg2Ry0deDj9gSqasVbND5mu/GUm/8gwVrYVckZMACU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040