UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Done9KyE60WqUyZWbe/Tb89veMuL83V51+mZtcnKAaI=' 
WHERE 
  key_id = '6a320ae2e1b72039196dcdedaed7e2d952b7a36908273e0ad21a4b7a60ca1224' 
  AND (
    token = 'Done9KyE60WqUyZWbe/Tb89veMuL83V51+mZtcnKAaI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030